import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
import * as commentApi from "@/api";
export default new Vuex.Store({
  state: {
    commentlist: [],
  },
  mutations: {
    SET_COMMENT_LIST(state, payload) {
      state.commentlist = payload;
      console.log(state.commentlist);
    },
  },
  actions: {
    GET_COMMENT_LIST({ commit }) {
      commentApi.getComment().then((res) => {
        console.log(res);
        commit("SET_COMMENT_LIST", res.data.data);
      });
    },
  },
  getters: {},
  modules: {},
});
